Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

349
Visualizações
error:ReferenceError: upload is not defined error:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

so ive been trying to do an nft collection by a video from youtube ( i dont know nothing in coding ) and it keep giving me this error:

' error:ReferenceError: upload is not defined error:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined '

How can i resolve it?

I had a previous error that i resolved by installing npm i node-fetch@2.6.1

Anyways, know i have this one and just cant go anyfurther,

Would appreciate any help, THANK YOU

const fetch = require('node-fetch');
const path = require("path");
const basePath = process.cwd();
const fs = require("fs");

fs.readdirSync(`${basePath}/build/images`).forEach(File => {
 const formData = new FormData();
 const fileStream = fs.createReadStream(`${basePath}/build/images/${File}`);
 formData.append('file',fileStream);
 
 let url = '';

 let options = {
   method: 'POST',
   headers: {
    Authorization: '',
  },
  body: formData
 };

 options.body = formData;

 fetch(url, options)
  .then((res) => res.json())
  .then((json) => {
    const filename = path.parse(json.file_name).name;
    let rawdata = fs.readFileSync(`${basePath}/build/json/${filename}.json`);
    let metadata = JSON.parse(rawdata);

    metadata.file_url = json.ipfs_url;

    fs.writeFileSync(`${basePath}/build/json/${filename}.json`,
    JSON.stringify(metadata, null, 2));

    console.log(`${json.file_name} uploaded & ${upload}.json
    updated!`);
  })
  .catch((err) => console.error('error:' + err));
});```
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda